import * as actionTypes from "./actionTypes";
import { fromJS } from "immutable"; //把数据转为immutable对象，使用这个使用更要使用gget方法，使用set方法去变更state内容
 
const defaultState = fromJS({
  selectCity:  "北京", 
  cityList:['北京','上海','杭州','广州','深圳','合肥','郑州','山东']
});
// 导出一个纯函数
export default (state = defaultState, action) => {
  switch (action.type) {
    // case actionTypes.ChangeUser:
    //   return state.set("userInfor", fromJS(action.data));
    // case actionTypes.ChangeType:
    //   return state.set("type", action.data);
    case  actionTypes.SelectCity:
      return state.set("selectCity", action.data);
      // break;
      default:
        return state;
  }
};
